package cn.online.taxi.api.passenger.controller;

import cn.online.taxi.common.pojo.Result;
import cn.online.taxi.common.utils.ResultUtil;
import cn.online.taxi.verifycode.service.VerifyCodeService;
import com.alibaba.dubbo.config.annotation.Reference;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Api(value = "乘客验证码")
public class SmsController {

    @Reference
    private VerifyCodeService verifyCodeService;

    @RequestMapping(value = "/verify-code/send", method = RequestMethod.POST)
    @ApiOperation(value = "生成验证码")
    public Result<Object> generateVerifyCode(String phoneNumber) {
        verifyCodeService.generate(1, phoneNumber);
        return new ResultUtil<Object>().setData(null);
    }
}
